package com.erlinyou.im.web.controller.base;

import java.util.Map;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value = "ResultJson",description = "统一响应JSON")
public class ResultJson<T>{
	/**
	 * 1	成功
	 * 99	系统异常
	 */
	@ApiModelProperty(notes = "响应码", required = true)
	private int code = ResultCode.SUCCESS.getCode();// 是否成功
//	@ApiModelProperty(notes = "提示信息", required = true)
//	private String msg = ResultCode.SUCCESS.getMsg();// 提示信息
	@ApiModelProperty(notes = "响应对象", required = false)
	private T obj = null;// 其他信息
	@ApiModelProperty(notes = "扩展属性", required = false)
	private Map<String, Object> attributes;// 其他参数
	public int getCode() {
		return code;
	}
	public ResultJson<T> setCode(int code) {
		this.code = code;
		return this;
	}
//	public String getMsg() {
//		return msg;
//	}
//	public ResultJson<T> setMsg(String msg) {
//		this.msg = msg;
//		return this;
//	}
	public T getObj() {
		return obj;
	}
	public ResultJson<T> setObj(T obj) {
		this.obj = obj;
		return this;
	}
	public Map<String, Object> getAttributes() {
		return attributes;
	}
	public ResultJson<T> setAttributes(Map<String, Object> attributes) {
		this.attributes = attributes;
		return this;
	}

	
}
